import axios from 'axios';

export function myGet(url, params) {
  return new Promise((resolve, reject) => {
    axios.get(url, {
        params
      }).then(function (response) {
        resolve(response.data)
      })
      .catch(function (err) {
        reject(err)
      })
  })
}

export function myPost(url, params) {
  return new Promise((resolve, reject) => {
    axios.post(url, params)
    .then(function (response) {
        console.log("111");
        console.log("response", response);
        resolve(response.data)
      })
      .catch(function (err) {
        console.log("222");
        console.log("err", err);
        reject(err)
      })
  })
}